package cn.edu.fzu.homemaking.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.edu.fzu.homemaking.domain.dto.SysCompanyDTO;
import cn.edu.fzu.homemaking.domain.entity.SysCompany;
import cn.edu.fzu.homemaking.domain.enums.StatusEnum;

/**
 * @author yifan
 * @date 2023/4/4
 */
public interface SysCompanyMapper {

    List<SysCompany> list(@Param("name") String name, @Param("creditCode") String creditCode,
                          @Param("legalPerson") String legalPerson, @Param("businessLicense") String businessLicense,
                          @Param("contact") String contact, @Param("phone") String phone,
                          @Param("status") StatusEnum status, @Param("areaIdList") List<Long> areaIdList,
                          @Param("labelId") Long labelId);


    List<SysCompanyDTO> listForCount();


    Integer insertCompany(@Param("name") String name, @Param("creditCode") String creditCode,
                          @Param("legalPerson") String legalPerson, @Param("businessLicense") String businessLicense,
                          @Param("contact") String contact, @Param("phone") String phone,
                          @Param("status") StatusEnum status, @Param("areaId") Long areaId,
                          @Param("address") String address);


    Integer update(@Param("id") Long id, @Param("name") String name, @Param("creditCode") String creditCode,
                   @Param("legalPerson") String legalPerson, @Param("businessLicense") String businessLicense,
                   @Param("contact") String contact, @Param("phone") String phone, @Param("status") StatusEnum status,
                   @Param("areaId") Long areaId, @Param("address") String address);


    /**
     * 分配标签
     *
     * @param companyId
     * @param labelIds
     * @return
     */
    Integer assignLabels(@Param("companyId") Long companyId, @Param("labelIds") List<Long> labelIds);


    Integer removeLabels(@Param("companyId") Long companyId, @Param("labelIds") List<Long> labelIds);


    Integer assignLabel(@Param("companyId") Long companyId, @Param("labelId") Long labelId);


    Integer removeLabel(@Param("companyId") Long companyId, @Param("labelId") Long labelId);


    SysCompanyDTO getById(@Param("id") Long id);


    Integer countService(@Param("companyId") Long companyId, @Param("labelId") Long labelId);
}
